
using System;
using System.Web;
using System.Web.UI;


namespace webpman
{
	
	
	public partial class @report : System.Web.UI.Page
	{
		
		protected void Page_Load(object sender, EventArgs e)
        {
			
			
			// Manager for generic objects, settings, languages and skins
			General GeneralClass = new General();
						
			// Update current webpage with right settings
			Page MyPage = this;
			GeneralClass.SetEnvironment(ref MyPage);
			this.Page = MyPage;
			
			// Init DB and set GeneralClass Object on Master Page
			GeneralClass.DBOpen();
			((master1)this.Master).MasterGeneral = GeneralClass;
			
			
			// Code....
			ABasile.Utility Uman = new ABasile.Utility();

			#region Check Data Integrity
			
			if (Request.QueryString["object"] == null)
			{
				resultdiv.InnerHtml = 
					Uman.GetErrorMessage(GeneralClass.RMan.GetString("missingparameter"));
				return;
			}

			if (Request.QueryString["pid"] == null)
			{
				resultdiv.InnerHtml = 
					Uman.GetErrorMessage(GeneralClass.RMan.GetString("missingparameter"));
				return;
			}

			if (Request.QueryString["object"].ToString() == "")
			{
				resultdiv.InnerHtml = 
					Uman.GetErrorMessage(GeneralClass.RMan.GetString("missingparameter"));
				return;
			}

			if (Request.QueryString["pid"].ToString() == "")
			{
				resultdiv.InnerHtml = 
					Uman.GetErrorMessage(GeneralClass.RMan.GetString("missingparameter"));
				return;
			}

			#endregion Check Data Integrity
			
			// Update Page
			if (Session["USER"] != null)
			{
					// Get Data Report
					resultdiv.InnerHtml = GeneralClass.DBGetReport(Request.QueryString["object"].ToString() , 
				                                                   Request.QueryString["pid"].ToString() ,
				                                               	   Session["USER"].ToString(),
				                                                   Session["AUTH"].ToString());
			}

			
        }
	}
}
